import Mock from "mockjs";
const zixunlist = Mock.mock({
  "data|55": [
    {
      "name|1": ["端午节", "元旦节", "清明节", "中秋节", "国庆节"],
      "type|1": ["线上活动", "线下活动"],
      pic: "",
      actime: "2021-12-24 18:00",
      ovtime: "2022-01-24 18:00",
      "acsatus|": ["活动中", "活动结束"],
      "acclick|1000-5000": 5000,
      "shuliang|1000-5000": 2000,
      operation: "查看",
    },
  ],
});
class Mockapi {
  getzixun1(current_page: number, page_size: number) {
    const newList = zixunlist.data.slice(
      (current_page - 1) * page_size,
      (current_page - 1) * page_size + page_size
    );
    return Promise.resolve({
      status: 0,
      result: newList,
    });
  }
  getzixun() {
    return Promise.resolve({
      status: 0,
      result: zixunlist,
    });
  }
  //查询列表
  chazhaozixun(obj:any){
    const newzixun = zixunlist.data.filter((item:any)=>{
        if(obj.mc==item.name||obj.lx==item.type||obj.zt==obj.acsatus){
          return item
        }
    })
    return Promise.resolve({
      status: 0,
      result: newzixun,
    });
  }
}
export const mockapi = new Mockapi();
